package com.example.service.impl;

import com.example.mapper.SuperUserMapper;
import com.example.pojo.SuperUser;
import com.example.service.SuperUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

/**
 * 名称SuperUserServiceImpl
 * 描述
 *
 * @version 1.0
 * @author:wanghao
 * @datatime:2023,04,16,17,31
 */
@Service
@Primary
public class SuperUserServiceImpl implements SuperUserService {
    @Autowired
    SuperUserMapper superUserMapper;

    @Override
    public String CheckSuperUerPasswd(String name,String passwd)
    {
        SuperUser superUser=superUserMapper.CheckSuperUserLogin(name);
        if (superUser!=null)
        {
            if (superUser.getPasswd().equals(passwd)) return "true";
            else return "wrong passwd";
        }
        else return "not exist";
    }

    @Override
    public int InsertSuperUser(SuperUser superUser){
        return superUserMapper.InsertSuperUser(superUser);
    }
}
